import service from "@/service";
import { getLoginData } from "@/tools";
let app = getLoginData();
//根据用户登录id,租户id查询标段列表数据
export function getBlockList(parameter) {
  let { userId, tenantCode } = parameter;
  let { permissionCode } = app;
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/user/sys-org/getSGInfoByTenatCode?userId=${userId}&tenantCode=${tenantCode}`,
    method: "POST",
    data: {
      systemCode: permissionCode,
    },
  });
}

//查询拌和站列表数据
export function getMixinList(parameter) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/config-equ/getByCondition`,
    method: "POST",
    data: parameter,
  });
}

//查询桥号列表数据
export function getComponentPartList(parameter) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/sn-zl/queryComponentPart`,
    method: "GET",
    params: parameter,
  });
}

//查询结构类型
export function getstructureList(parameter) {
  let { equCode, secCode } = parameter;
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/lq/config-ratio/queryBySecCodeAndEquCode`,
    method: "GET",
    params: { equCode, secCode },
  });
}

//查询工程名称
export function queryEngineerName(parameter) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/sn-mp-data/queryEngineerName`,
    method: "GET",
    params: parameter,
  });
}

//查询浇筑部位
export function queryPlacePart(parameter) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/sn-mp-data/queryPlacePart`,
    method: "GET",
    params: parameter,
  });
}
//查询强度等级
export function getstrengthList(parameter) {
  let { equCode, secCode, projectName, placePart } = parameter;
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/sn-mp-data/queryStrengthGrade`,
    method: "GET",
    params: { equCode, secCode, projectName, placePart },
  });
}

//查询桥梁列表数据
export function getBridgeList(parameter) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/sn-zl/queryBridgeName`,
    method: "GET",
    params: parameter,
  });
}

//查询字段列表
export function getField(parameter) {
  let { equCode, flag = "1", display = "1" } = parameter;
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/config-equ-fieldcfg/equFieldList`,
    method: "POST",
    data: { equCode, flag, display },
  });
}
